//
//  htvhomepage.m
//  PHApp
//
//  Created by zhangwq on 16/4/6.
//  Copyright © 2016年 HT. All rights reserved.
//

#import "htvhomepage.h"
#import "HTFrameKit.h"
#import "HTSysKit.h"
#import "HTFrameConvert.h"

@interface htvhomepage (){
    NSMutableArray *itemArray;
    NSMutableArray *topIdArray;
    CGFloat width;
    CGFloat height;
}

@property ABCIntroView *introView;

@end

@implementation htvhomepage

- (void)viewDidLoad {
    [super viewDidLoad];
    
    CGRect rect = [[UIScreen mainScreen] bounds];
    CGSize size = rect.size;
    width = size.width;
    height = size.height;
    
    itemArray=[NSMutableArray array];
    
    NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:
                          @"1",@"id",
                          @"产品选样第一名", @"title",
                          @"3月16日-3月18日", @"datestr",
                          @"http://7xshdz.com2.z0.glb.clouddn.com/12250700_125326482104_2.jpg", @"picPath",
                          @"ML-140928", @"name",
                          @"仿真丝雪纺印花", @"name2",
                          @"在这段时间，共被选中24次", @"foot",
                          nil];
    
    NSDictionary *dic2 = [NSDictionary dictionaryWithObjectsAndKeys:
                         @"2",@"id",
                         @"客户选样第一名", @"title",
                         @"3月16日-3月18日", @"datestr",
                         @"http://7xshdz.com2.z0.glb.clouddn.com/2014082211372361.jpg", @"picPath",
                         @"James Ive", @"name",
                         @"Maxmara.Inc", @"name2",
                         @"在这段时间，共被选中25个样品", @"foot",
                         nil];
    
    NSDictionary *dic3 = [NSDictionary dictionaryWithObjectsAndKeys:
                         @"3",@"id",
                         @"业务选样第一名", @"title",
                         @"3月16日-3月18日", @"datestr",
                         @"http://7xshdz.com2.z0.glb.clouddn.com/u=2891552014,4028509334&fm=21&gp=0.jpg", @"picPath",
                         @"李佳翔", @"name",
                         @"业务经理", @"name2",
                         @"在这段时间，共商谈了15个客户", @"foot",
                         nil];
    
    [itemArray addObject:dic];
    [itemArray addObject:dic2];
    [itemArray addObject:dic3];
    
    [topIdArray insertObject:@"1" atIndex:1];
    [topIdArray insertObject:@"2" atIndex:1];
    [topIdArray insertObject:@"3" atIndex:1];
    
    
    self.introView = [[ABCIntroView alloc] initWithFrame:CGRectMake(0, 0, width, height)];
    self.introView.delegate = self;
    self.introView.clickFlag=1;
    self.introView.fitFlag=1;
    self.introView.picArray=itemArray;
    self.introView.idArray=topIdArray;
    [self.view addSubview:self.introView];
    
    [self setNavigationbar];
    
    
    

    
}



- (void)setNavigationbar
{
    CGRect screenRect = [[UIScreen mainScreen] bounds];
    UINavigationBar *navigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, screenRect.size.width, 64)];
    //创建UINavigationItem
    UINavigationItem * navigationBarTitle = [[UINavigationItem alloc] initWithTitle:@"品汇"];
    [self.view addSubview: navigationBar];
    [navigationBar setItems:[NSArray arrayWithObject: navigationBarTitle]];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
   
}


-(void)onDoneButtonPressed:(NSString *)formid{
    NSString *storyboard=@"TablePage";
    NSString *Identifier=@"TablePage";
    UIStoryboard *valueView = [UIStoryboard storyboardWithName:storyboard bundle:nil];
    UIViewController *uv=[valueView instantiateViewControllerWithIdentifier:Identifier];
    UINavigationController *baNavigation = [[UINavigationController alloc] initWithRootViewController:uv];
    [uv setValue:formid forKey:@"formid"];
    [self presentModalViewController:baNavigation animated:YES];
    
    //返回
}







@end
